Implement cpu_physical_memory_reset_dirty()
authoradsharma@los-vmm.sc.intel.com <adsharma@los-vmm.sc.intel.com>
Mon, 22 Aug 2005 18:31:19 +0000 (11:31 -0700)
committeradsharma@los-vmm.sc.intel.com <adsharma@los-vmm.sc.intel.com>
Mon, 22 Aug 2005 18:31:19 +0000 (11:31 -0700)
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
tools/ioemu/cpu-all.h
tools/ioemu/exec.c
tools/ioemu/hw/vga.c

index 6e9a8b8ac5ab744a82cb998875fe87e9d23b3a5d..7374c2e8a0fd7e2d88077c02e463350d2529a776 100644 (file)
@@ -672,6 +672,8 @@ static inline void cpu_physical_memory_write(target_phys_addr_t addr,
 int cpu_memory_rw_debug(CPUState *env, target_ulong addr, 
                         uint8_t *buf, int len, int is_write);
 
+#define VGA_DIRTY_FLAG 0x01
+
 /* read dirty bit (return 0 or 1) */
 static inline int cpu_physical_memory_is_dirty(target_ulong addr)
 {
index 102798e26a47b6a8ba7626aab877014bd0df4a73..286b3cd7f01b0be5cde1b5fd51b3811005cbf952 100644 (file)
@@ -461,4 +461,14 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
 
 void cpu_physical_memory_reset_dirty(target_ulong start, target_ulong end)
 {
+       uint8_t *p;
+       int len;
+
+       if ((len = (end - start)) <= 0)
+               return;
+       p = phys_ram_dirty + (start >> TARGET_PAGE_BITS);
+       len = len >> TARGET_PAGE_BITS;
+       while (len > 0)
+               p[--len] &= ~VGA_DIRTY_FLAG;
+       return;
 }
index 2867bd55d45d6ba8641d325234a011fe89892272..144ae741c67fea168d4e78f37cb4567e07f724c7 100644 (file)
@@ -1620,7 +1620,6 @@ static CPUWriteMemoryFunc *vga_mem_write[3] = {
 static void vga_save(QEMUFile *f, void *opaque)
 {
     VGAState *s = opaque;
-    int i;
 
     qemu_put_be32s(f, &s->latch);
     qemu_put_8s(f, &s->sr_index);
@@ -1661,7 +1660,7 @@ static void vga_save(QEMUFile *f, void *opaque)
 static int vga_load(QEMUFile *f, void *opaque, int version_id)
 {
     VGAState *s = opaque;
-    int is_vbe, i;
+    int is_vbe;
 
     if (version_id != 1)
         return -EINVAL;